import 'dart:convert';

class OrderModel {
  final int? orderId;
  final String? orderNo;
  final int? appType;
  final int? memberId;
  final int? mId;
  final int? tId;
  final String? tName;
  final String? contacts;
  final String? mobile;
  final int? goodsId;
  final String? goodsTitle;
  final String? goodsPrice;
  final String? goodsServiceDuration;
  final int? payNum;
  final int? sex;
  final String? orderPrice;
  final String? commutePrice;
  final String? couponPrice;
  final String? payTime;
  final int? orderStatus;
  final String? orderServiceTime;
  final String? qrCodeUrl;
  final int? codeNumber;
  final int? isAnmo;
  final String? createTime;
  final String? distance;
  final String? travelMode;
  final int? operationStatus;
  final int? bindMId;
  final double? lon;
  final double? lat;
  final int? isTransferOrder;
  final String? transferOrderTime;
  final String? paymentServiceChargePrice;
  final int? transferTid;
  final String? transferTname;
  final int? transferMid;
  final int? transferBindMid;
  final String? vipGoodsPrice;
  final String? appTypeName;
  final String? orderWeekServiceTime;
  final String? nickname;
  final String? memberImg;
  final String? imUser;
  final String? imName;
  final String? imImg;
  final String? goodsDesc;
  final String? goodsImg;
  final String? tHeadImg;
  final String? mName;
  final String? mImg;
  final String? mMobile;
  final String? tMobile;
  final int? jumpType;
  final String? autoReturnTime;
  final String? buttonGroups;
  final String? orderTips;
  final String? orderTipsColor;
  final int? androidButtonReceived;
  final int? memberServiceStatus;
  final int? isImportantTips;
  final int? changeServiceStatus;
  final String? orderChangeServiceMsg;
  final String? startServiceDes;
  final int? serviceTime;
  final int? addsId;

  final String? serviceFormatTime;
  final int? futureReturnTime;
  final String? futureReturnFormatTime;
  final String? orderDuration;
  final String? waitOrderDuration;
  final String? orderReceivingTips;
  final String? orderArriveTips;
  final String? orderServiceStartTips;
  final String? orderServiceCompleteTips;

  OrderModel({
    this.orderId,
    this.orderNo,
    this.appType,
    this.memberId,
    this.mId,
    this.tId,
    this.sex,
    this.addsId,
    this.tName,
    this.mobile,
    this.contacts,
    this.goodsId,
    this.goodsTitle,
    this.goodsPrice,
    this.goodsServiceDuration,
    this.payNum,
    this.orderPrice,
    this.commutePrice,
    this.couponPrice,
    this.payTime,
    this.orderStatus,
    this.orderServiceTime,
    this.qrCodeUrl,
    this.codeNumber,
    this.isAnmo,
    this.createTime,
    this.distance,
    this.travelMode,
    this.operationStatus,
    this.bindMId,
    this.lon,
    this.lat,
    this.isTransferOrder,
    this.transferOrderTime,
    this.paymentServiceChargePrice,
    this.transferTid,
    this.transferTname,
    this.transferMid,
    this.transferBindMid,
    this.vipGoodsPrice,
    this.appTypeName,
    this.orderWeekServiceTime,
    this.nickname,
    this.memberImg,
    this.imUser,
    this.imName,
    this.imImg,
    this.goodsDesc,
    this.goodsImg,
    this.tHeadImg,
    this.mName,
    this.mImg,
    this.mMobile,
    this.tMobile,
    this.jumpType,
    this.autoReturnTime,
    this.buttonGroups,
    this.orderTips,
    this.orderTipsColor,
    this.androidButtonReceived,
    this.memberServiceStatus,
    this.isImportantTips,
    this.changeServiceStatus,
    this.orderChangeServiceMsg,
    this.startServiceDes,
    this.serviceTime,
    this.serviceFormatTime,
    this.futureReturnTime,
    this.futureReturnFormatTime,
    this.orderDuration,
    this.waitOrderDuration,
    this.orderReceivingTips,
    this.orderArriveTips,
    this.orderServiceStartTips,
    this.orderServiceCompleteTips,
  });

  factory OrderModel.fromJson(String str) => OrderModel.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory OrderModel.fromMap(Map<String, dynamic> json) => OrderModel(
        orderId: json["order_id"],
        orderNo: json["order_no"],
        appType: json["app_type"],
        memberId: json["member_id"],
        mId: json["m_id"],
        tId: json["t_id"],
        tName: json["t_name"],
        contacts: json['contacts'],
        mobile: json["mobile"],
        goodsId: json["goods_id"],
        goodsTitle: json["goods_title"],
        goodsPrice: json["goods_price"],
        goodsServiceDuration: json["goods_service_duration"],
        payNum: json["pay_num"],
        orderPrice: json["order_price"],
        commutePrice: json["commute_price"],
        couponPrice: json["coupon_price"],
        payTime: json["pay_time"],
        orderStatus: json["order_status"],
        orderServiceTime: json["order_service_time"],
        qrCodeUrl: json["qr_code_url"],
        codeNumber: json["code_number"],
        isAnmo: json["is_anmo"],
        sex: json['sex'],
        createTime: json["create_time"],
        distance: json["distance"],
        travelMode: json["travel_mode"],
        operationStatus: json["operation_status"],
        bindMId: json["bind_m_id"],
        lon: json["lon"]?.toDouble(),
        lat: json["lat"]?.toDouble(),
        isTransferOrder: json["is_transfer_order"],
        transferOrderTime: json["transfer_order_time"],
        paymentServiceChargePrice: json["payment_service_charge_price"],
        transferTid: json["transfer_tid"],
        transferTname: json["transfer_tname"],
        transferMid: json["transfer_mid"],
        transferBindMid: json["transfer_bind_mid"],
        vipGoodsPrice: json["vip_goods_price"],
        appTypeName: json["app_type_name"],
        orderWeekServiceTime: json["order_week_service_time"],
        nickname: json["nickname"],
        memberImg: json["member_img"],
        imUser: json["im_user"],
        imName: json["im_name"],
        addsId: json['adds_id'],
        imImg: json["im_img"],
        goodsDesc: json["goods_desc"],
        goodsImg: json["goods_img"],
        tHeadImg: json["t_head_img"],
        mName: json["m_name"],
        mImg: json["m_img"],
        mMobile: json["m_mobile"],
        tMobile: json["t_mobile"],
        jumpType: json["jump_type"],
        autoReturnTime: json["auto_return_time"],
        buttonGroups: json["button_groups"],
        orderTips: json["order_tips"],
        orderTipsColor: json["order_tips_color"],
        androidButtonReceived: json["android_button_received"],
        memberServiceStatus: json["member_service_status"],
        isImportantTips: json["is_important_tips"],
        changeServiceStatus: json["change_service_status"],
        orderChangeServiceMsg: json["order_change_service_msg"],
        startServiceDes: json["start_service_des"],
        serviceTime: json["service_time"],
        serviceFormatTime: json["service_format_time"],
        futureReturnTime: json["future_return_time"],
        futureReturnFormatTime: json["future_return_format_time"],
        orderDuration: json["order_duration"],
        waitOrderDuration: json["wait_order_duration"],
        orderReceivingTips: json["order_receiving_tips"],
        orderArriveTips: json["order_arrive_tips"],
        orderServiceStartTips: json["order_service_start_tips"],
        orderServiceCompleteTips: json["order_service_complete_tips"],
      );

  Map<String, dynamic> toMap() => {
        "order_id": orderId,
        "order_no": orderNo,
        "app_type": appType,
        "member_id": memberId,
        "m_id": mId,
        "contacts": contacts,
        "t_id": tId,
        "t_name": tName,
        "mobile": mobile,
        "goods_id": goodsId,
        "goods_title": goodsTitle,
        "goods_price": goodsPrice,
        "goods_service_duration": goodsServiceDuration,
        "pay_num": payNum,
        "order_price": orderPrice,
        "commute_price": commutePrice,
        "coupon_price": couponPrice,
        "pay_time": payTime,
        "order_status": orderStatus,
        "order_service_time": orderServiceTime,
        "qr_code_url": qrCodeUrl,
        "code_number": codeNumber,
        "is_anmo": isAnmo,
        "create_time": createTime,
        "distance": distance,
        "travel_mode": travelMode,
        "operation_status": operationStatus,
        "bind_m_id": bindMId,
        "lon": lon,
        "lat": lat,
        "is_transfer_order": isTransferOrder,
        "transfer_order_time": transferOrderTime,
        "payment_service_charge_price": paymentServiceChargePrice,
        "transfer_tid": transferTid,
        "transfer_tname": transferTname,
        "transfer_mid": transferMid,
        "transfer_bind_mid": transferBindMid,
        "vip_goods_price": vipGoodsPrice,
        "app_type_name": appTypeName,
        "order_week_service_time": orderWeekServiceTime,
        "nickname": nickname,
        "member_img": memberImg,
        "im_user": imUser,
        "im_name": imName,
        "im_img": imImg,
        "goods_desc": goodsDesc,
        "goods_img": goodsImg,
        "t_head_img": tHeadImg,
        "m_name": mName,
        "m_img": mImg,
        "m_mobile": mMobile,
        "t_mobile": tMobile,
        "jump_type": jumpType,
        "auto_return_time": autoReturnTime,
        "button_groups": buttonGroups,
        "order_tips": orderTips,
        "order_tips_color": orderTipsColor,
        "android_button_received": androidButtonReceived,
        "member_service_status": memberServiceStatus,
        "is_important_tips": isImportantTips,
        "change_service_status": changeServiceStatus,
        "order_change_service_msg": orderChangeServiceMsg,
        "start_service_des": startServiceDes,
        "service_time": serviceTime,
        "service_format_time": serviceFormatTime,
        "future_return_time": futureReturnTime,
        "future_return_format_time": futureReturnFormatTime,
        "order_duration": orderDuration,
        "wait_order_duration": waitOrderDuration,
        "order_receiving_tips": orderReceivingTips,
        "order_arrive_tips": orderArriveTips,
        "order_service_start_tips": orderServiceStartTips,
        "order_service_complete_tips": orderServiceCompleteTips,
      };
}
